package com.zhm.demo.netty.bean;

import io.netty.channel.Channel;
import io.netty.channel.ChannelId;

/**
 * 1.TCPClient长连接对象
 * 2.该对象与实际业务绑定。
 */
public class TcpClient {

    private String userId;
    private String authorization;
    private ChannelId channelId;
    private long connectionTimestamp;
    private Channel channel;

    public TcpClient(String userId,ChannelId channelId,String authorization ,long currentTimeMillis) {
        this.userId=userId;
        this.channelId = channelId;
        this.authorization = authorization;
        this.connectionTimestamp = currentTimeMillis;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public ChannelId getChannelId() {
        return channelId;
    }

    public void setChannelId(ChannelId channelId) {
        this.channelId = channelId;
    }

    public String getAuthorization() {
        return authorization;
    }

    public void setAuthorization(String authorization) {
        this.authorization = authorization;
    }

    public long getConnectionTimestamp() {
        return connectionTimestamp;
    }
    public void setConnectionTimestamp(long connectionTimestamp) {
        this.connectionTimestamp = connectionTimestamp;
    }
    public Channel getChannel() {
        return channel;
    }
    public void setChannel(Channel channel) {
        this.channel = channel;
    }


    @Override
    public String toString() {
        return "TcpClient{" +
                "userId='" + userId + '\'' +
                ", authorization='" + authorization + '\'' +
                ", channelId=" + channelId +
                ", connectionTimestamp=" + connectionTimestamp +
                ", channel=" + channel +
                '}';
    }
}
